
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[spOwner_UpdateOwner]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spOwner_UpdateOwner]
GO

GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eric Liew
-- Create date: 6/2/2009
-- Description:	Insert a Owner
-- =============================================
CREATE PROCEDURE [dbo].[spOwner_UpdateOwner]
(
	@OwnerId INT,
	@CompanyName Varchar(100),
	@Title Varchar(50),
	@FirstName Varchar(50),
	@LastName Varchar(50),
	@Street1 Varchar(50),
	@Street2 Varchar(50),
	@Suburb Varchar(50),
	@State Varchar(50),
	@Postcode Varchar(4),
	@Phone Varchar(10),
	@Mobile Varchar(10),
	@ABN Varchar(20)

)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	SET NOCOUNT ON;
	UPDATE Owner
	SET 		
		CompanyName = @CompanyName,
		Title = @Title,
		FirstName = @FirstName,
		LastName = @LastName,
		Street1 = @Street1,
		Street2 = @Street2,
		Suburb = @Suburb,
		State = @State,
		Postcode = @Postcode,
		Phone = @Phone,
		Mobile = @Mobile,
		ABN = @ABN
	WHERE
	OwnerId = @OwnerID    

END
GO
